<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>方法的调用</title>
    <style type="text/css">
        #box{position: relative; width: 100px; height: 100px;
            background-color: red; margin: 10px auto;}
        #close{position: absolute; right: 0px; top: -4px; color: yellow;}
        #btn{display: block; width: 100px; margin: 0 auto;}
        .hide{display: none;}
    </style>
</head>
<body>
<div id="box">
    <span id="close">X</span>
</div>
<button id="btn">关闭</button>
<script type="text/javascript">
    // 在此处补充代码
    var close=document.getElementById("close");
    var box=document.getElementById("box");
    var btn=document.getElementById("btn");
    btn.onclick=function(){
        box.style.display="none";
    };
    close.onclick=function(){
        btn.onclick();
    }
</script>
</body>
</html>